!**************************************************************************
! This module sets up floating point precision in a portable way using
! Fortran 90 extensions. This was written on a Sun SPARC, so the ranges
! quoted here are the maximums for the selected kind on SPARC systems.
! A different platform may give you HIGHER precision than this code was
! tested for, but never lower.
! The value D ("default") is used throughout the code except in special
! cases, so this value can be easily adjusted for more/less precision.
!
! Kind R4 has 6 digit precision with exponent in (-37,37) or greater.
! This generally corresponds to REAL or REAL*4 in FORTRAN 77.
!
! Kind R8 has 15 digit precision with exponent in (-307,307) or greater.
! Usually corresp. to a F77 DOUBLE PRECISION or REAL*8.
!
! Kind R16 has 33 digit precision with exponent in (-4931,4931) or greater.
! Usually an F77 QUAD PRECISION or REAL*16.
!**************************************************************************
module mPrecision

        implicit none

        integer, parameter :: R4 = selected_real_kind(6, 37), &
                              R8 = selected_real_kind(15, 307), &
                              R16 = selected_real_kind(33, 4931), &
!                              D = R4
                              D = R8
!                              D = R16

        private
        public :: R4, R8, R16, D

end module mPrecision
